package com.platform.comm.repository;

import com.querydsl.core.types.dsl.StringExpression;
import com.querydsl.core.types.dsl.StringPath;
import com.platform.comm.entity.CommDataInfoEntity;
import com.platform.comm.entity.QCommDataInfoEntity;
import org.springframework.data.querydsl.binding.QuerydslBinderCustomizer;
import org.springframework.data.querydsl.binding.QuerydslBindings;
import org.springframework.data.querydsl.binding.SingleValueBinding;
import org.springframework.stereotype.Repository;

/**
 * @author Administrator
 */
@Repository
public interface CommDataInfoRepository extends CustomBaseRepository<CommDataInfoEntity, String>, QuerydslBinderCustomizer<QCommDataInfoEntity> {
    /**
     * 定义查询
     *
     * @param bindings QuerydslBindings
     * @param resource QCommDataImpEntity
     */
    @SuppressWarnings("NullableProblems")
    @Override
    default void customize(QuerydslBindings bindings, QCommDataInfoEntity resource) {
        bindings.bind(String.class)
                .first((SingleValueBinding<StringPath, String>) StringExpression::containsIgnoreCase);
    }
}
